package com.yksj.healthtalk.ui.news;

import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import org.apache.commons.lang.math.NumberUtils;
import org.handmark.pulltorefresh.library.PullToRefreshBase;
import org.handmark.pulltorefresh.library.PullToRefreshListView;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import org.universalimageloader.core.DefaultConfigurationFactory;
import org.universalimageloader.core.DisplayImageOptions;
import org.universalimageloader.core.ImageLoader;
import org.universalimageloader.utils.StorageUtils;

import android.content.Context;
import android.content.Intent;
import android.graphics.drawable.BitmapDrawable;
import android.net.Uri;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
import android.widget.BaseAdapter;
import android.widget.CheckBox;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.PopupWindow;
import android.widget.TextView;

import com.open.share.OpenManager;
import com.yksj.healthtalk.comm.BaseFragmentActivity;
import com.yksj.healthtalk.comm.ImageGalleryActivity;
import com.yksj.healthtalk.comm.ShareDialogFragment;
import com.yksj.healthtalk.net.http.AsyncHttpResponseHandler;
import com.yksj.healthtalk.net.http.HttpRestClient;
import com.yksj.healthtalk.net.http.JsonHttpResponseHandler;
import com.yksj.healthtalk.net.socket.SmartFoxClient;
import com.yksj.healthtalk.ui.R;
import com.yksj.healthtalk.ui.app.AppData;
import com.yksj.healthtalk.ui.friend.FriendInformUI;
import com.yksj.healthtalk.ui.setting.PersonalInformationActivity;
import com.yksj.healthtalk.utils.ToastUtil;
import com.yksj.healthtalk.utils.WheelUtils;

/**
 * 
 * 新闻内容显示页面
 * 
 * @author zhao
 * 
 */
public class NewsContentActivity extends BaseFragmentActivity implements
		OnClickListener {
	boolean isCollection = false;// 是否收藏了
	String newsId;
	String mSmartUserId;

	TextView titleTextView;
	TextView contentTextView;
	TextView timeTextView;
	CheckBox collectionCheckBox;// 收藏
	TextView shareTextView;// 分享
	TextView repeatTextView;// 转发
	TextView commenTextView;// 评论
	// TextView commentNumberTxt;//评论数量

	NewsCommensAdapter adapter;
	ListView mListView;
	PullToRefreshListView refreshListView;
	LinearLayout mLinearLayout;// 动态添加imageview
	PopupWindow mPopupWindow;
	View mShareView;

	JSONArray mImagePathArray;
	JSONObject mJsonObject;// 新闻内容
	ImageLoader mImageLoader;
	DisplayImageOptions mDisplayImageOptions;
	List<String> urlList = new ArrayList<String>();
	String hasCate = "news";
	private int defaultImageId;

	@Override
	protected void onCreate(Bundle arg0) {
		super.onCreate(arg0);
		setContentView(R.layout.news_content_layout);

		newsId = getIntent().getStringExtra("newsId");
		defaultImageId = getIntent().getIntExtra("defaultImageId", 0);
		isCollection = getIntent().getBooleanExtra("isCollection", false);
		boolean hasCategory = getIntent().hasExtra("type");
		if (hasCategory)
			hasCate = getIntent().getStringExtra("type");
		mSmartUserId = SmartFoxClient.getLoginUserId();
		mImageLoader = ImageLoader.getInstance();
		mDisplayImageOptions = DefaultConfigurationFactory
				.createGalleryDisplayImageOptions(this);
		initView();
		initData();
	}

	@Override
	public void onClick(View v) {
		switch (v.getId()) {
		case R.id.title_back:
			onBackPressed();
			break;
		case R.id.news_comment:// 新闻评论
			onComment(mSmartUserId, newsId, "0");
			break;
		case R.id.news_collection:// 收藏
			onCollectionCountUpdate(collectionCheckBox.isChecked());
			break;
		case R.id.news_share:// 分享
			onShareClick();
			break;
		case R.id.news_repeat:// 转发

			break;
		case R.id.news_share_sina:
			if (mPopupWindow != null && mPopupWindow.isShowing()) {
				mPopupWindow.dismiss();
			}
			shareTxt(OpenManager.SINA_WEIBO);
			break;
		case R.id.news_share_qq:
			if (mPopupWindow.isShowing())
				mPopupWindow.dismiss();
			shareTxt(OpenManager.TENCENT_WEIBO);
			break;
		case R.id.news_share_renren:
			if (mPopupWindow.isShowing())
				mPopupWindow.dismiss();
			shareTxt(OpenManager.RENREN);
			break;
		case R.id.news_share_mesg:
			shareNewsByMessage();
			break;
		case R.id.invite_cancel:
			if (mPopupWindow.isShowing()) {
				mPopupWindow.dismiss();
			}
			break;
		default:
			if (v instanceof ImageView) {// 图片点击
				Intent intent = new Intent(this, ImageGalleryActivity.class);
				intent.putExtra(ImageGalleryActivity.URLS_KEY,
						urlList.toArray(new String[urlList.size()]));
				intent.putExtra(ImageGalleryActivity.TYPE_KEY, 1);// 0,1单个,多个
				intent.putExtra("type", 1);// 0,1单个,多个
				startActivityForResult(intent, 100);
			}
			break;
		}
	}

	@Override
	protected void onActivityResult(int requestCode, int resultCode, Intent data) {
		super.onActivityResult(requestCode, resultCode, data);
		switch (requestCode) {
		case 1000:
			if (resultCode == RESULT_OK) {// 评论返回
				String size = adapter.getCommentSize();
				int countSize = Integer.valueOf(size) + 1;
				adapter.setCommentSize(String.valueOf(countSize));
				updateCommentTxtView(String.valueOf(countSize));
				onDoQueryComment("-1", adapter.getFirstId(), "5");
			}
			break;
		}

	}

	private void initView() {
		initTitle();
		titleLeftBtn.setOnClickListener(this);
		titleTextV.setText("健康要闻");
	}

	private void onBundData() {
		refreshListView = (PullToRefreshListView) findViewById(R.id.listview);
		mListView = refreshListView.getRefreshableView();
		mListView.addHeaderView(onCreateContentView(), null, false);
		mListView.addFooterView(LayoutInflater.from(this).inflate(
				R.layout.list_line_layout, null));
		mListView.setAdapter(adapter = new NewsCommensAdapter(this));

		refreshListView
				.setOnRefreshListener(new PullToRefreshBase.OnRefreshListener2() {
					@Override
					public void onPullDownToRefresh(PullToRefreshBase refreshView) {
					}

					@Override
					public void onPullUpToRefresh(PullToRefreshBase refreshView) {
						int size = adapter.getCount();
						if (size > 1) {
							String id;
							try {
								id = adapter.getReplyId(adapter
										.getItem(size - 1));
								onDoQueryComment("1", id, "5");
							} catch (JSONException e) {
								e.printStackTrace();
								refreshListView.onRefreshComplete();
							}
						} else {
							onDoQueryComment("0",String.valueOf(Long.MAX_VALUE), "10");
						}
					}
				});
	}

	/**
	 * 发表评论
	 * 
	 * @param userid
	 * @param newsid
	 * @param replyId
	 *            对某一条评论的id
	 */
	private void onComment(String userid, String newsid, String replyId) {
		Intent intent = new Intent(this, NewsCommenActivity.class);
		intent.putExtra("userId", mSmartUserId);
		intent.putExtra("newsId", newsId);
		intent.putExtra("title", titleTextV.getText());
		intent.putExtra("replyId", replyId);
		startActivityForResult(intent, 1000);
	}

	private void initData() {
		HttpRestClient.doHttpQueryNewsContentDetail(mSmartUserId, newsId,
				hasCate, new JsonHttpResponseHandler(this) {

					@Override
					public void onSuccess(int statusCode, JSONObject response) {
						super.onSuccess(statusCode, response);
						onBundData();
						mJsonObject = response;
						onParseData(response);
						onDoQueryComment("0", "0", "5");
					}

					@Override
					public void onFailure(Throwable error, String content) {
						super.onFailure(error, content);
					}
				});
	}

	private void showToast(final String id) {
		if (!isFinishing())
			NewsContentActivity.this.runOnUiThread(new Thread() {
				@Override
				public void run() {
					ToastUtil.showShort(NewsContentActivity.this, id);
				}
			});
	}

	/**
	 * 分享
	 */
	private void onShareClick() {
		if (mPopupWindow == null) {
			mShareView = LayoutInflater.from(NewsContentActivity.this).inflate(
					R.layout.news_share_window_layout, null);
			mPopupWindow = new PopupWindow(mShareView,
					LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
			mPopupWindow.setTouchable(true);
			mPopupWindow.setBackgroundDrawable(new BitmapDrawable());
			mPopupWindow.setOutsideTouchable(true);
			mPopupWindow.setAnimationStyle(R.style.AnimationPreview);
			mShareView.findViewById(R.id.news_share_sina).setOnClickListener(
					this);
			mShareView.findViewById(R.id.news_share_qq)
					.setOnClickListener(this);
			mShareView.findViewById(R.id.news_share_renren).setOnClickListener(
					this);
			mShareView.findViewById(R.id.news_share_mesg).setOnClickListener(
					this);
			mShareView.findViewById(R.id.invite_cancel)
					.setOnClickListener(this);
			WheelUtils.setPopeWindow(this, mShareView, mPopupWindow);
		} else {
			WheelUtils.setPopeWindow(this, mShareView, mPopupWindow);
		}
	}

	private void onParseData(JSONObject data) {
		try {
			String cllections = data.optString("COLLECTION_COUNT", "0");
			String comments = data.optString("COMMENT_COUNT", "0");
			String forwards = data.optString("FORWARD_COUNT", "0");
			String shares = data.optString("SHARE_COUNT", "0");
			String time = data.getString("PROMULGATE_TIME");
			String title = data.getString("CONTENT_TITLE");
//			String content =ToDBC( data.getString("INFO_CLIENT"));
			String content = data.getString("INFO_CLIENT");
			String isCollectionTag = data.optString("ISCOLLECTION", "N");

			if (data.has("PICTURES")) {
				JSONArray array = data.getJSONArray("PICTURES");
				for (int i = 0; i < array.length(); i++) {
					JSONObject jsonObject = array.getJSONObject(i);
					String picPath = jsonObject.getString("MENUPIC");
					ImageView imageView = new ImageView(this);
					imageView.setLayoutParams(new LayoutParams(
							LayoutParams.MATCH_PARENT,
							LayoutParams.WRAP_CONTENT));
					mLinearLayout.addView(imageView);
					imageView.setClickable(true);
					imageView.setOnClickListener(this);
					urlList.add(picPath);
					if (defaultImageId != 0) {
						imageView.setImageResource(defaultImageId);
					}else {
						mImageLoader.displayImage(picPath, imageView,mDisplayImageOptions);
					}
				}
			}
			// 更新评论数量
			adapter.setCommentSize(comments);
//			titleTextV.setText(getIntent().getStringExtra("title"));
//			titleTextV.setTextSize(19);
			titleTextView.setText(title);
			contentTextView.setText(content);
			timeTextView.setText(time);
			collectionCheckBox
					.setChecked("Y".equalsIgnoreCase(isCollectionTag));
			collectionCheckBox.setText(cllections);
			shareTextView.setText(shares);
			commenTextView.setText(comments);
			repeatTextView.setText(forwards);
		} catch (JSONException e) {
			e.printStackTrace();
		}
	}

	/**
	 * 查询评论
	 * 
	 * @param type
	 */
	private void onDoQueryComment(final String type, final String lastId,
			String size) {
		// 第一次1,之后为0;
		HttpRestClient.doHttpQueryNewsComment(newsId, lastId, size, type,
				new JsonHttpResponseHandler() {
					@Override
					public void onSuccess(int statusCode, JSONObject response) {
						try {
							JSONArray jsonArray = response
									.getJSONArray("PARAMETER2");
							// String count =
							// response.optString("PARAMETER1","0");
							if ("1".equals(type)) {// 查询最新的评论
								adapter.onDataChange(jsonArray, 0);
								refreshListView.onRefreshComplete();
							} else if ("0".equals(type)) {// 第一次查询
								adapter.onDataChange(jsonArray, 0);
							} else if ("-1".equals(type)) {// 查询之前的评论
								adapter.onDataChange(jsonArray, -1);
							}
						} catch (JSONException e) {
							e.printStackTrace();
						}
					}

					@Override
					public void onFailure(Throwable error, String content) {
						super.onFailure(error, content);
						if ("0".equals(type) || "1".equals(type)) {
							refreshListView.onRefreshComplete();
						}
					}
					@Override
					public void onFinish() {
						super.onFinish();
						refreshListView.onRefreshComplete();
					}
				});
	}

	/**
	 * 
	 * 显示新闻内容视图
	 * 
	 * @return
	 * 
	 */
	private View onCreateContentView() {
		View view = LayoutInflater.from(this).inflate(
				R.layout.news_content_header_layout, null);
		mLinearLayout = (LinearLayout) view
				.findViewById(R.id.news_count_images);
		titleTextView = (TextView) view.findViewById(R.id.headerTxt);
		contentTextView = (TextView) view.findViewById(R.id.contentTxt);
		timeTextView = (TextView) view.findViewById(R.id.timeTxt);
		collectionCheckBox = (CheckBox) view.findViewById(R.id.news_collection);
		collectionCheckBox.setOnClickListener(this);

		shareTextView = (TextView) view.findViewById(R.id.news_share);
		shareTextView.setOnClickListener(this);
		repeatTextView = (TextView) view.findViewById(R.id.news_repeat);
		repeatTextView.setOnClickListener(this);
		commenTextView = (TextView) view.findViewById(R.id.news_comment);
		commenTextView.setOnClickListener(this);

		collectionCheckBox.setChecked(NewsUtil.isCollectionted(this, newsId));
		return view;
	}

	/**
	 * 通过短信
	 */
	private void shareNewsByMessage() {
		// onUpdateRepeatSize();
		Intent intent = new Intent(Intent.ACTION_SENDTO, Uri.parse("smsto:"));
		intent.putExtra("sms_body", "我在壹健康看到一条值得分享的内容:"
				+ titleTextView.getText().toString().trim()
				+ "更多内容查看http://yijiankangv.mobi/SJ/download.html");// contentTextView.getText()
		startActivity(intent);
	}

	class NewsCommensAdapter extends BaseAdapter {
		List<JSONObject> list = new ArrayList<JSONObject>();
		final Context mContext;
		final LayoutInflater inflater;

		public NewsCommensAdapter(Context context) {
			mContext = context;
			inflater = LayoutInflater.from(mContext);
			try {
				JSONObject jsonObject = new JSONObject();
				jsonObject.put("SIZE", 0);
				list.add(jsonObject);
			} catch (JSONException e) {
				e.printStackTrace();
			}
		}

		@Override
		public int getCount() {
			return list.size();
		}

		private String getFirstId() {
			int length = list.size();
			if (length > 1) {
				try {
					return getReplyId(getItem(1));
				} catch (JSONException e) {
					e.printStackTrace();
				}
			}
			return "0";
		}

		@Override
		public JSONObject getItem(int position) {
			return list.get(position);
		}

		@Override
		public long getItemId(int position) {
			return position;
		}

		@Override
		public int getItemViewType(int position) {
			if (position == 0)
				return 1;
			return 2;
		}

		@Override
		public int getViewTypeCount() {
			return 3;
		}

		public void onDataChange(JSONArray array, int type) {
			if (array.length() == 0)
				return;
			if (type == -1) {// 现在以后的评论
				for (int i = 0; i < array.length(); i++) {
					try {
						list.add(1, array.getJSONObject(i));
					} catch (JSONException e) {
						e.printStackTrace();
					}
				}
			} else {// 现在以前的评论
				for (int i = 0; i < array.length(); i++) {
					try {
						list.add(array.getJSONObject(i));
					} catch (JSONException e) {
						e.printStackTrace();
					}
				}
			}
			notifyDataSetChanged();
		}

		/**
		 * 设置评论数量的大小
		 * 
		 * @param zie
		 * @return
		 */
		public void setCommentSize(String zie) {
			JSONObject jsonObject = getItem(0);
			try {
				jsonObject.put("SIZE", zie);
			} catch (JSONException e) {
				e.printStackTrace();
			}
			notifyDataSetChanged();
		}

		public String getCommentSize() {
			JSONObject jsonObject = getItem(0);
			String size = null;
			try {
				size = jsonObject.getString("SIZE");
			} catch (JSONException e) {
				e.printStackTrace();
			}
			return size;
		}

		public String getReplyId(JSONObject jsonobj) throws JSONException {
			return jsonobj.getString("REPLY_ID");
		}

		public String getNikeName(JSONObject jsonobj) throws JSONException {
			return jsonobj.getString("CUSTOMER_NICKNAME");
		}

		public String getTime(JSONObject jsonObject) throws JSONException {
			return jsonObject.getString("REPLYTIME");
		}

		public String getContent(JSONObject jsonObject) throws JSONException {
			String string = jsonObject.getString("UPPER_REPLY_ID");
			if ("0".equals(string)) {
				return jsonObject.getString("COMMENT_CONTENT");
			} else {
				if (jsonObject.getString("SUPPER_NICKNAME").equals("")) {
					return "回复" + string + "-"
							+ jsonObject.getString("COMMENT_CONTENT");
				} else {
					return "回复" + jsonObject.getString("SUPPER_NICKNAME") + "-"
							+ jsonObject.getString("COMMENT_CONTENT");
				}
			}
		}

		public String getHeadrImgPath(JSONObject jsonObject)
				throws JSONException {
			return jsonObject.getString("CLIENT_ICON_BACKGROUND");
		}

		// 评论者的多美号
		public String getUserNumBer(JSONObject jsonObject) throws JSONException {
			return jsonObject.getString("CUSTOMER_ACCOUNTS");
		}

		// 评论者的id
		public String getUserId(JSONObject jsonObject) throws JSONException {
			return jsonObject.getString("CUSTOMER_ID");
		}

		@Override
		public View getView(int position, View convertView, ViewGroup parent) {
			final int type = getItemViewType(position);
			final JSONObject jsonObject = getItem(position);
			final ViewHolder holder;

			if (convertView == null) {
				if (type == 1) {
					convertView = inflater.inflate(
							R.layout.news_comment_size_list_item, null);
					holder = new ViewHolder();
					convertView.setTag(holder);
				} else {
					convertView = inflater.inflate(
							R.layout.news_comment_list_item, null);
					holder = new ViewHolder();
					convertView.setTag(holder);

					holder.headerImageView = (ImageView) convertView
							.findViewById(R.id.head_image);
					holder.nameTextView = (TextView) convertView
							.findViewById(R.id.nameTxt);
					holder.timeTextView = (TextView) convertView
							.findViewById(R.id.timeTxt);
					holder.contentTextView = (TextView) convertView
							.findViewById(R.id.contentTxt);
					holder.repeatImageView = (ImageView) convertView
							.findViewById(R.id.comment_repeat);
				}
			} else {
				holder = (ViewHolder) convertView.getTag();
			}

			if (type == 1) {
				((TextView) convertView).setText(getCommentSize() + "条评论");
			} else {
				try {
					String time = getTime(jsonObject);
					String name = getNikeName(jsonObject);
					String content = getContent(jsonObject);
					String headerPath = getHeadrImgPath(jsonObject);
					final String userNum = getUserNumBer(jsonObject);
					final String userId = getUserId(jsonObject);
					final String replyId=getReplyId(jsonObject);
					holder.nameTextView.setText(name);
					holder.contentTextView.setText(content);
					holder.timeTextView.setText(time);
					holder.repeatImageView
							.setOnClickListener(new OnClickListener() {
								@Override
								public void onClick(View v) {
									onComment(mSmartUserId, newsId, replyId);
								}
							});
					convertView.setOnClickListener(new OnClickListener() {

						@Override
						public void onClick(View v) {
							if (mSmartUserId.equals(userId)) {
								Intent intent = new Intent(
										NewsContentActivity.this,
										PersonalInformationActivity.class);
								startActivity(intent);
							} else {
								Intent intent = new Intent(NewsContentActivity.this,FriendInformUI.class);
								intent.putExtra("id", userId);
								startActivity(intent);
							}

						}
					});
					mImageLoader.displayImage(jsonObject.getString("CUSTOMER_SEX"),headerPath,holder.headerImageView);
				} catch (JSONException e) {
					e.printStackTrace();
				}
			}
			return convertView;
		}
	}

	static class ViewHolder {
		TextView nameTextView;
		TextView timeTextView;
		TextView contentTextView;
		ImageView headerImageView;
		ImageView repeatImageView;
	}

    
	
	/**
	 * 分享到微博
	 * 
	 * @param txt
	 * @param type
	 */
	public void shareTxt(int type) {

		OpenManager openManager = OpenManager.getInstatnce();
		boolean isEnable = OpenManager.getInstatnce().isVaild(type, this);
		if (!isEnable)
			openManager.authorize(type, this);
		else {
			String title = titleTextView.getText().toString().trim();
			String txt = contentTextView.getText().toString().trim();
			txt = title + "\r\n" + txt;
			if (txt.length() > 65)
				txt = txt.substring(0, 65);
			txt = String.format(AppData.ShareContent, txt);
//			Bundle bundle = new Bundle();
//			bundle.putString(OpenManager.BUNDLE_KEY_TEXT, txt);
			String imageFilePath=null;
			//如果有图片的话  带图片一起分享
			if (StorageUtils.isSDMounted()&&(!urlList.isEmpty())) {
				String dir = StorageUtils.getImagePath();
				String imagePath = urlList.get(0);
				File file = mImageLoader.getOnDiscFileName(new File(dir),imagePath);
				if(file.exists())
					imageFilePath=file.getAbsolutePath();
//				bundle.putString(OpenManager.BUNDLE_KEY_IMGPATH,file.getAbsolutePath());
			}
			
			ShareDialogFragment.show(getSupportFragmentManager(), type, txt,
					imageFilePath, new ShareDialogFragment.OnShareResultListener() {
						@Override
						public void onResult(int result) {
							if (result == 0) {
								String size = shareTextView.getText()
										.toString();
								if (NumberUtils.isNumber(size)) {
									int commSize = Integer.valueOf(size) + 1;
									shareTextView.setText(String
											.valueOf(commSize));
								} else {
									shareTextView.setText("1");
								}
								HttpRestClient.doHttpNewsShareCount(
										mSmartUserId, newsId, null);
							}
						}
					});
		}
	}

	/**
	 * 收藏计数更新
	 * 
	 * @param isCollection
	 */
	private void onCollectionCountUpdate(final boolean isCollection) {
		collectionCheckBox.setClickable(false);
		if (isCollection) {
			HttpRestClient.doHttpNewsCollectionAdd(mSmartUserId, newsId,
					new AsyncHttpResponseHandler(this) {
						@Override
						public void onSuccess(int statusCode, String content) {
							if ("1".equals(content)) {
								onUpdateCollectionNumber(isCollection);
							} else {
							}
							super.onSuccess(statusCode, content);
						}
						@Override
						public void onFinish() {
							super.onFinish();
							collectionCheckBox.setClickable(true);
						}
					});
		} else {
			HttpRestClient.doHttpNewsCollectionRemove(mSmartUserId, newsId,
					"news", new AsyncHttpResponseHandler(this) {
						@Override
						public void onSuccess(int statusCode, String content) {
							if ("1".equals(content)) {
								onUpdateCollectionNumber(isCollection);
							}
							collectionCheckBox.setClickable(true);
						}
					});
		}
	}

	/**
	 * 
	 * 更新收藏数量
	 * 
	 */
	public void onUpdateCollectionNumber(boolean isCollection) {
		String size = collectionCheckBox.getText().toString();
		int collectionSize = 0;
		if (NumberUtils.isNumber(size)) {
			collectionSize = Integer.valueOf(size);
		}
		if (isCollection) {
			ToastUtil.showToastPanl("收藏成功");
			collectionSize++;
		} else {
			ToastUtil.showToastPanl("已取消收藏");
			collectionSize--;
		}
		collectionCheckBox.setText(String.valueOf(collectionSize));
	}

	public void onUpdateRepeatSize() {
		String size = shareTextView.getText().toString();
		if (NumberUtils.isNumber(size)) {
			int commSize = Integer.valueOf(size) + 1;
			shareTextView.setText(String.valueOf(commSize));
		} else {
			shareTextView.setText("1");
		}
	}

	public void updateCommentTxtView(String value) {
		commenTextView.setText(value);
	}
}
